package com.alibaba.druid.sql;

public class TestTranslateDm {

    public static void main(String[] args) {

        String mysql = "SELECT\n" +
                "        ep.*,\n" +
                "        GROUP_CONCAT(distinct r.ROLE_NAME separator ';') roleName,\n" +
                "        GROUP_CONCAT(distinct dept.dept_name separator ';') deptName,\n" +
                "        GROUP_CONCAT(distinct dept.dept_id separator ',') deptId\n" +
                "        FROM\n" +
                "        qx_ent_police ep\n" +
                "        left join qx_ent_police_dept pd on ep.id = pd.police_id\n" +
                "        LEFT JOIN qx_sys_dept dept ON pd.dept_id = dept.DEPT_ID\n" +
                "        left join qx_ent_police_role pr on ep.id = pr.police_id\n" +
                "        left join qx_ent_role r on pr.role_id = r.role_id\n" +
                "        WHERE\n" +
                "        ep.status != '-1'\n" +
                "        GROUP BY ep.id\n" +
                "        order by ep.id desc";

        String gaussSql = SQLUtils.translateMysqlToDM(mysql);
        System.out.println(gaussSql);
    }
}
